﻿Public Class Progress

    Private Sub Progress_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.Timer1.Start()
        Me.Timer2.Start()

    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        If Me.prbDeletion.Value >= 100 Then
            Try
                For Each runningprocess As Process In Process.GetProcessesByName("explorer")
                    If runningprocess.StartTime > DateTime.Now.AddSeconds(-30) Then
                        runningprocess.Kill()
                    End If
                Next
            Catch
            End Try
            Me.Close()
        Else
            Me.Timer1.Interval = 1
        End If
    End Sub

    Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
        If Me.prbDeletion.Value < 100 Then
            Me.prbDeletion.Value += 2
        End If
    End Sub
End Class